package com.itheima.jdbc;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author CC小天才
 * @website www.flyskill.cn
 * @date 2021/10/13 22:36
 **/

public class updateAccountTest {

    ApplicationContext applicationContext=new ClassPathXmlApplicationContext("applicationContext.xml");
    AccountDao accountDao= (AccountDao) applicationContext.getBean("accounDao");
    Account account=new Account();
    account.setId(1);
    account.setUsername("Tom");
    account.setBalance(2000.00);
    int num=accountDao.updateAccount(account);
    if(num>0){
       System.out.println("成功修改了"+num+"条数据");
    }else{
        System.out.println("修改数据失败！);
    }
}
